﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>信阳房产网-楼市图写系统</title>
<style type="text/css">
*{ margin:0 auto; text-align:center}
.style{ height:30px; width:310px;}
.style_A{ width:400px; margin-top:12%; background:#FFF;filter:alpha(opacity:80);opacity:0.8;border-radius: 3px;}
span{ font-size:22px; color:#D8080C}
.f{ background:#DC3B68; width:115px;; text-align:center;border-radius: 3px; height:60px; float:left;filter:alpha(opacity:80);opacity:0.8;}
a{ text-decoration:none; color:#000000; margin-left:0px; line-height:30px;}
</style>
</head>
<body background="bj.jpg">

<form action="index.php" method="post">
<div class="style_A">
<div style="height:20px;"></div>
<h3>信阳房产网-楼市图<span>铺红</span>写入</h3>
<div style="height:20px;"></div>
<div class="style">楼盘中文名称一: <input type="text" name="name" required></div> 

<div class="style">楼盘英文名称一: <input type="text" name="file"  required></div> 
<div class="style">楼盘英文名称二: <input type="text" name="nameb"  required ></div> 


<div class="style">坐    标   一: <input type="text" name="filea" required></div> 
<div class="style">坐    标   二: <input type="text" name="fileb" required></div> 
<div class="style">坐    标   三: <input type="text" name="filec" required></div> 
<div class="style">坐    标   四: <input type="text" name="filed" required></div> 
<div class="style">坐    标   五: <input type="text" name="filee" required></div> 
<div class="style">工 号 代 码: <input type="text" name="gh" required></div> 

<div class="style"><input type="submit" value="赶紧提交吧"></div>
</div>

</form>
<?php
if(isset($_POST['name'])&&isset($_POST['gh'])){
	
  $name=$_POST["name"];
  $nameb=$_POST["nameb"];
  $file=$_POST["file"];
  $filea=$_POST["filea"];
  $fileb=$_POST["fileb"];
  $filec=$_POST["filec"];
  $filed=$_POST["filed"];
  $filee=$_POST["filee"];
  $gh=$_POST["gh"];

  
  $weidu="//创建经纬度数组---------------------------";
  $Polygon="Polygon";
  $Label2="Label2";
  $Label="Label";
        $myfile = fopen("$gh.js", "a") or die("打开文件失败！");
		$txt = "\n";
        fwrite($myfile, $txt);
		//写入换行
        $txt ="$weidu$name";
        fwrite($myfile, $txt);
		
        $txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "var $file = new BMap.Point($filea);";
        fwrite($myfile, $txt);
		
        $txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "var $nameb = [
                 new BMap.Point($filea),
                 new BMap.Point($fileb),
				 new BMap.Point($filec),
				 new BMap.Point($filed),
				 new BMap.Point($filee)
				 ];";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "var $nameb$Polygon = new BMap.Polygon($nameb, {strokeColor:'blue', strokeWeight:2, strokeOpacity:0.5 ,fillColor:'red'});";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "map.addOverlay($nameb$Polygon);";
        fwrite($myfile, $txt);
		
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "$nameb$Polygon.addEventListener('mouseover',function(){
    $nameb$Polygon.setStrokeColor('blue');
    map.addOverlay($nameb$Label);
    map.panTo($file);
});";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "$nameb$Polygon.addEventListener('mouseout',function(){
    $nameb$Polygon.setStrokeColor('red');
    map.removeOverlay($nameb$Label);
});";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "var $nameb$Label = new BMap.Label('$name',{offset: new BMap.Size(0,0), position: $file});
$nameb$Label.setStyle({'z-index':'999999', 'padding': '10px','width': '140px','border': '1px solid #ccff00','background': '#fff'});";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "var $nameb$Label2 = new BMap.Label('$name',{offset: new BMap.Size(38,-28), position: $file});
$nameb$Label2.setStyle({'text-align': 'center',  'border': 'none', 'background': 'none','color':'#000','font-size':'15px'});";
        fwrite($myfile, $txt);
		
		$txt = "\n";
        fwrite($myfile, $txt);
		
		$txt = "map.addOverlay($nameb$Label2);";
        fwrite($myfile, $txt);
		
        fclose($myfile);
		
		echo "<div style='color:#090; margin-top:10px'>嘻嘻，$name 写入成功了！</div>";
		
}else{
   echo "<div style='color:#F00;  margin-top:10px'>不好意思，写入失败了！</div>";
}
		
?>

<div class="f">
 <p><a href="dian.php">楼市图点录入</a></p>
 <p><a href="index.html">楼市图查看</a></p>
</div>


</body>
</html>




